﻿using System;
using System.Collections.Generic;
using System.Text;
using Gbu.BLTool.BaseTool;
using Gbu.BLTool.Entitys;
using RestSharp;

namespace Gbu.BLTool.Logics
{
    public class UserInfoBl
    {

        public void GetUserInfo(Action<CommResponseEntity<UserRet>> callback, UserReq req)
        {
            var client = new CommRestClient();

            var reqItem = new CommRequestEntity<UserReq>
                {
                    ReqName = "User/{id}",
                    ReqMethod = Method.GET,
                    ReqParam = req
                };

            client.Call<UserReq,UserRet>(reqItem, callback);
        }

        public void Test()
        {
            var bl = new UserInfoBl();
            bl.GetUserInfo(OnCallback,new UserReq(){Id="1"});
        }

        private void OnCallback(CommResponseEntity<UserRet> target)
        {

        }
    }
}
